#define _CRT_SECURE_NO_WARNINGS 1
#include"DySeqList.h"
void iniSeq(Seqlist* ps)
{
	ps->a = NULL;
	ps->capacity = 0;
	ps->size = 0;
}
void Seqpushback(Seqlist* ps, Seqtype x)
{
	if (ps->size == ps->capacity)
	{
		int newcapacity = ps->capacity == 0 ? 4 : ps->capacity * 2;
		Seqlist* temp = (Seqlist*)realloc(ps->a, newcapacity * sizeof(Seqlist));
		if (temp == NULL)
		{
			printf("realloc fail");
			exit(-1);
		}
		else
		{
			ps->a = temp;
			ps->capacity = newcapacity;
		}
	}
	ps->a[ps->size] = x;
	ps->size++;
}
void Seqprint(Seqlist* ps)
{
	for (int i = 0; i < ps->size; i++)
		printf("%d ", ps->a[i]);
}
